<?php
/*
 * 模板标签构造函数示例
 */

function __where_demo__($map){

}

function __orderby_demo__($orderby){

}

function __result_demo__($result){

}

function __sql_demo__($sql, $args){
    $m = M();
    $sql = $m->table('jl_archives arc, jl_addnews news')->where('arc.id = news.aid')->order('arc.sortrank desc')->buildSql();
}

function __process_demo__($rsArr, $args){
    $m = M();
    $pagesize = ($args['pagesize'] != '') ? $args['pagesize'] : '10';
    $count = $m->table('jl_archives arc, jl_addnews news')->where('arc.id = news.aid')->order('arc.sortrank desc')->count();
    $Page = new Page($count, $pagesize);
    $show = $Page->show();
    $rsArr = $m->table('jl_archives arc, jl_addnews news')->where('arc.id = news.aid')->order('arc.sortrank desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
    if (!empty($rsArr)) {
        foreach ($rsArr as $k => $v) {
            $rsArr[$k]['url'] = contentUrl($v['id']);
        }
    }
    $rsArr['pageline'] = $show;
}

/*
 * 自动表单钩子函数
 */
function __select__($rs){
    $rs = array(1 => 1, 2 => 2, 3 => 3);
    return;
}

function __checkbox__($rs){
    $rs = array(1 => 1, 2 => 2, 3 => 3);
    return;
}

function __radio__($rs){
    $rs = array(1 => 1, 2 => 2, 3 => 3);
    return;
}
?>